import { http } from '@/utils/http/axios';

/**
 * @description: 登录日志列表
 */
export function loginLogs(data?) {
  return http.request({
    url: '/loginLogs/search',
    method: 'post',
    data,
  });
}

/**
 * @description: 删除登录日志
 */
export function deleteLoginLogs(ids?) {
  return http.request({
    url: `/loginLog/${ids}`,
    method: 'delete',
  });
}

/**
 * @description: 操作日志列表
 */
export function actionLogs(data?) {
  return http.request({
    url: '/operationLogs/search',
    method: 'post',
    data,
  });
}

/**
 * @description: 删除操作日志
 */
export function deleteActionLogs(ids?) {
  return http.request({
    url: `/operationLog/${ids}`,
    method: 'delete',
  });
}

/**
 * @description: 导出登录日志
 */
export function exportLoginLogs(data) {
  return http.request(
    {
      url: `/loginLogs/export`,
      method: 'post',
      data,
      responseType: 'blob', // 二进制流
    },
    {
      isReturnNativeResponse: true,
    },
  );
}
